#ifndef CLIENT_H_
#define CLIENT_H_

//命令
typedef enum {
	CMD_TYPE_CD = 1,
	CMD_TYPE_LS,
	CMD_TYPE_PWD,
	CMD_TYPE_MKDIR,
	CMD_TYPE_RMDIR,
	CMD_TYPE_REMOVE,
	CMD_TYPE_PUTS,
	CMD_TYPE_GETS,
    CMD_TYPE_NOTCMD
} CmdType;
//命令TLV
typedef struct train_s
{
	int _length;
	CmdType taskType;
	char _data[1000];
} train_t;

//连接
int tcpConnection(const char *ip, const char *port);

int recvn(int sockfd,void * buf,int length);

int sendn(int sockfd,const void * buf,int length);

//Epoll
int epollAdd(int epfd,int fd);
int epollDel(int epfd,int fd);



int parseCommand(const char * input,int len, train_t * pt);

int getCommandType(const char * str);

void uploadFile(int sockfd,train_t *pt);

void downloadFile(int sockfd, train_t *pt);

#endif
